﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Thaire.Investment.Common
{
   public  class DataConverter
    {
        public static String ConvertIntToString(int? data)
        {
            if (data.HasValue)
                return data.Value.ToString();

            return null;
        }

        public static int? ConvertStringToIntNull(string value)
        {
            int v = 0;
            if (int.TryParse(value, out v))
            {
                return v;
            }
            return null;

        }

        public static decimal? ConvertStringToDecimalNull(string value)
        {
            decimal v = 0;
            if (decimal.TryParse(value, out v))
            {
                return v;
            }
            return null;

        }
    }
}
